// 增加或编辑弹出层
function saveOrUpdateForm(title, recordId) {
	// 需要定制的地方:title,和提交表单时的参数id
	$("#addFormDiv").removeClass("hide");
	layer.open({
		type : 1,
		area: '50%',
		offset: 0,
		shift: 1,
		title : title,
		content : $("#addFormDiv"),
		btn: ['确定', '取消'],
		yes: function(index, layero) {
			var serializeStr = $("#addForm").serialize();
			if (recordId == 'undefined') {
				serializeStr += '&id=' + id;
			}
			$.post('act/actList', serializeStr, function(data){
				alert(serializeStr);
			})
			layer.close(index);
		},
		cancel: function(index) {
			layer.msg("已取消");
		}
	})
}
// 填充表格
function userList(data) {
	var dataStr = "";
	$.each(data, function(i, v) {
		dataStr += '<tr>'
			+ '<td>' + v.name + '</td>'
			+ '<td>' + v.uri + '</td>'
			+ '<td>' + v.status + '</td>'
			+ '<td><a href="' + v.id + '" class="editButton">' + '编辑' + '</a></td>'
		+ '</tr>';
	});
	$("#dataTable").html(dataStr);
	$(".editButton").click(function(){
		saveOrUpdateForm('编辑菜单', 1);
		return false;
	});

	$("#dataTable tr").click(function() {
		alert(1);
	});
}